package com.yami.shop.mystery.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.mystery.common.model.ActivityProd;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 活动扩展数据接口
 *
 * @author wxf
 * @date 2023/4/12 10:59
 */
public interface ActivityProdMapper extends BaseMapper<ActivityProd> {

    /**
     * 修改报名注水量
     *
     * @param activityProd
     */
    void updateWaterSoldNum(@Param("activityProd") ActivityProd activityProd);

    /**
     *  通过活动id，查询活动商品列表
     *
     * @param activityId
     * @return
     */
    List<ActivityProd> listByActivityId(@Param("activityId") Long activityId);


    ActivityProd getActivitySkuByActivityIdAndProdId(@Param("activityId") Long activityId,@Param("prodId") Long prodId);

    /**
     * 修改库存
     *
     * @param activityId
     * @param prodId
     * @param prodCount
     * @return
     */
    int updateStocks(@Param("activityId") Long activityId,@Param("prodId") Long prodId, @Param("prodCount") Integer prodCount);

    /**
     * 还原库存
     *
     * @param prodCount
     */
    int returnStocks(@Param("activityId") Long activityId,@Param("prodId") Long prodId, @Param("prodCount") Integer prodCount);
}
